
object zuoye2 {
  def main(args: Array[String]): Unit = {
    package org
    object Object0403 {
      def main(args: Array[String]): Unit = {
        val spark = SparkSession
          .builder()
          .master("local[*]")
          .appName("spark")
          .getOrCreate()
        val sc = spark.sparkContext
        sc.textFile("src/main/resources/words.txt").flatMap(_.split(""))
          .flatMap(_.spalit(""))
          .map(x => (x, 1))
          .reduceByKey((x, y) => x + y)
          .sortBy(_._2, ture)
          .foreach(println)
        val chinese1 = HanLP.segment("张三没吃早餐，中午想吃牛肉面")
        println(chinese1)
        println(chinese1.asScala.map(_.word.trim))
        val chinese2 = StandaTokenizer.segment("明天放假++清明节++过两周还有假期++五一劳动节")
        println(chinese2)
        println(chinese2.asScala.map(_.word.replaceAll("\\s+", "")))
        TextRankKyword.getKeywordList("速看！广东这五个地方将要拆迁，征收位置、面积、补偿和安置标准都已公布，快来看看有你家吗", 5)
          .forEach(println)

        sc.stop()
      }

    }}}


